package com.kehutong.payfees.entity.record;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

import org.coraframework.orm.annotation.Column;
import org.coraframework.orm.annotation.Table;
import org.coraframework.orm.annotation.UnSave;

import com.kehutong.common.entity.DataEntity;
import com.kehutong.payfees.enums.WaterSource;

/**
 * 订单记录
 * 与微信统一下单关联
 *
 * @author liuzhen (liuxing521a@163.com)
 * @createTime 2017年3月21日下午3:07:11
 */
@Table(value = "t_charge_record", multi = true)
public class ChargeRecord extends DataEntity {

    private static final long serialVersionUID = -4693238525886228167L;

    protected ChargeRecord(String code) {
        super(code);
    }

    @Column(comment = "商户id")
    private String mchId;
    
    @Column(comment = "商户名称")
    private String mchName;

    @Column(comment = "子商户id")
    private String subMchId;
    
    @Column(comment = "子商户名称")
    private String submchName;


    @Column(comment = "小区编号")
    private String communityNo;

    @Column(comment = "小区名称")
    private String communityName;

    @Column(comment = "房屋编号")
    private String houseNo;

    @Column(length = 64, comment = "外部交易号")
    private String exChangeCode;

    // contact.id employee.id
    @Column(comment = "会员编号")
    private String mbrCode;

    @Column(length = 32, comment = "付款人手机")
    private String mobile;

    @Column(length = 32, comment = "会员名称")
    private String mbrName;

    @Column(length = 255, comment = "付款人头像")
    private String avatar;

    @Column(comment = "订单总金额")
    private BigDecimal amt;

    @Column(comment = "充值结果[0:失败; 1:成功]")
    private boolean result;

    @Column(comment = "完成支付时间")
    private LocalDateTime chargeTime;

    @Column(comment = "微信交易类型[JSAPI,NATIVE,APP]")
    private String tradeType;

    // todo 银行类型枚举
    @Column(comment = "付款银行")
    private String bankType;

    @Column(comment = "商品id, NATIVE交易类型必传")
    private String productId;

    @Column(length = 64, comment = "微信生成的预支付会话标识")
    private String prepayId;

    @Column(length = 64, comment = "NATIVE交易类型生成的支付二维码")
    private String codeUrl;

    @Column(length = 128, comment = "用户在商户appid下的唯一标识")
    private String openid;

    @Column(length = 64, comment = "微信支付订单号")
    private String transactionId;

    @Column(comment = "业务类型")
    private WaterSource bizType;

    @Column(length = 64, comment = "备注")
    private String remark;

    @UnSave
    private List<String> fileIds;

    // todo 唯一订单号

    public String getMchId() {
        return mchId;
    }

    public void setMchId(String mchId) {
        this.mchId = mchId;
    }

    public String getMchName() {
        return mchName;
    }

    public void setMchName(String mchName) {
        this.mchName = mchName;
    }

    public String getExChangeCode() {
        return exChangeCode;
    }

    public void setExChangeCode(String exChangeCode) {
        this.exChangeCode = exChangeCode;
    }

    public String getMbrCode() {
        return mbrCode;
    }

    public void setMbrCode(String mbrCode) {
        this.mbrCode = mbrCode;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public String getMbrName() {
        return mbrName;
    }

    public void setMbrName(String mbrName) {
        this.mbrName = mbrName;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public BigDecimal getAmt() {
        return amt;
    }

    public void setAmt(BigDecimal amt) {
        this.amt = amt;
    }

    public boolean isResult() {
        return result;
    }

    public void setResult(boolean result) {
        this.result = result;
    }

    public LocalDateTime getChargeTime() {
        return chargeTime;
    }

    public void setChargeTime(LocalDateTime chargeTime) {
        this.chargeTime = chargeTime;
    }

    public String getCommunityNo() {
        return communityNo;
    }

    public void setCommunityNo(String communityNo) {
        this.communityNo = communityNo;
    }

    public String getCommunityName() {
        return communityName;
    }

    public void setCommunityName(String communityName) {
        this.communityName = communityName;
    }

    public String getHouseNo() {
        return houseNo;
    }

    public void setHouseNo(String houseNo) {
        this.houseNo = houseNo;
    }

    public String getBankType() {
        return bankType;
    }

    public void setBankType(String bankType) {
        this.bankType = bankType;
    }

    public String getTradeType() {
        return tradeType;
    }

    public void setTradeType(String tradeType) {
        this.tradeType = tradeType;
    }

    public String getProductId() {
        return productId;
    }

    public void setProductId(String productId) {
        this.productId = productId;
    }

    public String getPrepayId() {
        return prepayId;
    }

    public void setPrepayId(String prepayId) {
        this.prepayId = prepayId;
    }

    public String getCodeUrl() {
        return codeUrl;
    }

    public void setCodeUrl(String codeUrl) {
        this.codeUrl = codeUrl;
    }

    public String getOpenid() {
        return openid;
    }

    public void setOpenid(String openid) {
        this.openid = openid;
    }

    public String getTransactionId() {
        return transactionId;
    }

    public void setTransactionId(String transactionId) {
        this.transactionId = transactionId;
    }

    public WaterSource getBizType() {
        return bizType;
    }

    public void setBizType(WaterSource bizType) {
        this.bizType = bizType;
    }

	public String getSubMchId() {
		return subMchId;
	}

	public void setSubMchId(String subMchId) {
		this.subMchId = subMchId;
	}

	public String getSubmchName() {
		return submchName;
	}

	public void setSubmchName(String submchName) {
		this.submchName = submchName;
	}

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public List<String> getFileIds() {
        return fileIds;
    }

    public void setFileIds(List<String> fileIds) {
        this.fileIds = fileIds;
    }
}